/* GUI CONVERTED from rcdlabsr.p (converter v1.75) Tue Apr 10 12:04:16 2001 */
/* rcdlabsr.p -  Delete all absr_req related to a shipper line                */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.3.1.3 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 8.6          CREATED: 09/20/9         BY: TSI  *K005*            */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98        BY: *K1Q4* Alfred Tan      */
/* REVISION: 8.6    LAST MODIFIED: 06/24/99        BY: *K21D* Poonam Bahl     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00        BY: *N0KP* Mark Brown      */
/* $Revision: 1.3.1.3 $    BY: Jean Miller    DATE: 03/22/01 ECO: *P008*        */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/*INPUT PARAMETERS*/
define input parameter abs_recid as recid no-undo.

find abs_mstr
   where recid(abs_mstr) = abs_recid
no-lock.

for each absr_det
   where absr_shipfrom = abs_shipfrom and
         absr_id = abs_id
exclusive-lock:

   find schd_det where
        schd_type      = absr_type
    and schd_nbr       = absr_nbr
    and schd_line      = absr_line
    and schd_rlse_id   = absr_rlse_id
    and schd_date      = absr_date
    and schd_time      = absr_time
    and schd_interval  = absr_interval
    and schd_reference = absr_reference
   exclusive-lock no-error.

   if available schd_det then
      schd_all_qty = max(schd_all_qty - absr_qty,0).

   delete absr_det.

end. /* for each absr_det */
